package com.brainshare.common.enums;

/**
 * 筛查入口枚举
 * @author wll
 */
public enum AnEntranceEnum {
    HALL("0","大厅",3,2,1),
    RULE("1","规则页",3,1,2),
    ME("2","我的",6,1,3);

    private final String code;
    private final String info;
    private final int sectionCode;
    private final int moduleCode;
    private final int functionCode;

    AnEntranceEnum(String code, String info, int sectionCode, int moduleCode, int functionCode) {
        this.code = code;
        this.info = info;
        this.sectionCode = sectionCode;
        this.moduleCode = moduleCode;
        this.functionCode = functionCode;
    }

    public String getCode() {
        return code;
    }

    public String getInfo() {
        return info;
    }

    public int getSectionCode() {
        return sectionCode;
    }

    public int getModuleCode() {
        return moduleCode;
    }

    public int getFunctionCode() {
        return functionCode;
    }

    public static String getEntranceByPath(Integer sectionCode,Integer moduleCode,Integer functionCode){
        if (null==sectionCode||null==moduleCode||null==functionCode){
            return "";
        }
        for (AnEntranceEnum anEntranceEnum : AnEntranceEnum.values()) {
            if (anEntranceEnum.sectionCode==sectionCode
            &&anEntranceEnum.moduleCode==moduleCode
            &&anEntranceEnum.functionCode==functionCode){
                return anEntranceEnum.info;
            }
        }
        return "";
    }
}
